package com.example.demo.mapper;

import com.example.demo.medol.MessageInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Mapper
public interface MessageMapper {
    @Insert("insert into message_info(`from`,`to`,`message`) values(#{from},#{to},#{message})")
    public void insertMessage(MessageInfo messageInfo);
    @Select("select * from message_info where delete_flag=0")
    public List<MessageInfo> selectAll();
}
